package 设计模式.m_策略模式;

/**
 * @author caihe
 * @date 2023/3/14 11:22
 */
public class DragonSlayerContext {
    
    private DragonSlayingStrategy slayingStrategy;

    public DragonSlayerContext(DragonSlayingStrategy slayingStrategy) {
        this.slayingStrategy = slayingStrategy;
    }
    
    public void changeStrategy(DragonSlayingStrategy slayingStrategy) {
        this.slayingStrategy = slayingStrategy;
    }
    
    public void gotoBattle() {
        slayingStrategy.exec();
    }
    
    
}
